-- GENERATED SPELL FOR [Elemental Rift] --


function spell0_28452(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(12058,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_28452', 3000, 1)
end

function spell1_28452(pUnit, Event) --@Frostbolt,n/a--
pUnit:FullCastSpellOnTarget(9672,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_28452', 7000, 1)
end

function spell2_28452(pUnit, Event) --@Summon Frozen Earth,Self--
pUnit:FullCastSpellOnTarget(51648,pUnit)
pUnit:RegisterEvent('Sorts_28452', 550, 1)
end

function Sorts_28452(pUnit, Event)
local choix_sorts_28452 = math.random(0, 2)
if choix_sorts_28452 == 0 then
pUnit:RegisterEvent('spell0_28452', 1, 1)
end
if choix_sorts_28452 == 1 then
pUnit:RegisterEvent('spell1_28452', 1, 1)
end
if choix_sorts_28452 == 2 then
pUnit:RegisterEvent('spell2_28452', 1, 1)
end
end

function mob28452_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_28452', math.random(1500, 3000), 1)
end

function mob28452_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob28452_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob28452_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(28452, 1, 'mob28452_Action')
RegisterUnitEvent(28452, 2, 'mob28452_Leave')
RegisterUnitEvent(28452, 3, 'mob28452_Kill')
RegisterUnitEvent(28452, 4, 'mob28452_Die')
